#include <stdio.h>
#include <stdlib.h>

int main(int argc, char* argv[])
{
    char c;
    int braces = 0;
    while ((c = getchar()) != EOF) {
        if (c == '{') {
            braces += 1;
        }

        if (c == '}') {
            if (braces == 0)
                printf("error");
            else
                braces -= 1;
        }
    }

    if (braces > 0)
        printf("%d 不匹配的括号\n", braces);

    return 0;
}